#ifndef BDL_HEADER
#define BDL_HEADER

// afaik the BMD sections are the same as the BDL sections
// BDLs have a new section tho (the MDL3) that comes after
// the MAT3 section and before the TEX1

// this header needs
#include <stdio.h>
#include "../../J3DGRAPH.h"
#include "../BMD/BMD.h"

// BDL constants
umax J3DGRAPH_MIN_BDL_SIZE = 32; // need to understand better the BDL file format

// header
char * J3DGRAPH_BDL_START[2] = {"J3D2", "2D3J"};
char * J3DGRAPH_BDL_ID[2] = {"bdl4", "4ldb"};
#define J3DGRAPH_BDL_SEC_CNT 9

// for Super Mario Galaxy
byte J3DGRAPH_BDL_UNK_1[17] = {0x53, 0x56, 0x52, 0x33,
                               0xFF, 0xFF, 0xFF, 0xFF,
                               0xFF, 0xFF, 0xFF, 0xFF,
                               0xFF, 0xFF, 0xFF, 0xFF, 0x00};

// sections
char * J3DGRAPH_BDL_SEC_START[9][2] = {{"INF1", "1FNI"},
                                       {"VTX1", "1XTV"},
                                       {"EVP1", "1PVE"},
                                       {"DRW1", "1WRD"},
                                       {"JNT1", "1TNJ"},
                                       {"SHP1", "1PHS"},
                                       {"MAT3", "3TAM"},
                                       {"MDL3", "3LDM"},
                                       {"TEX1", "1XET"}};

// include the different BDL section headers
#include "INF1.h"
#include "VTX1.h"
#include "EVP1.h"
#include "DRW1.h"
#include "JNT1.h"
#include "SHP1.h"
#include "MAT3.h"
#include "MDL3.h"
#include "TEX1.h"

// function to check a BDL
j3dgraph_t check_j3dgraph_bdl(char * fpath);
// build/close/print a complete j3dgraph BDL structure
j3dgraph * open_j3dgraph_bdl(char * fpath);
void close_j3dgraph_bdl(j3dgraph * file);
void print_j3dgraph_bdl(j3dgraph * file);

#include "BDL.c"

#endif // BDL_HEADER
